package jn.cdz.rabbit.mq.sender;

import jn.cdz.rabbit.mq.entity.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PublishSender {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(User user) {
        rabbitTemplate.convertAndSend("fanoutExchange", "", user);
    }
}
